<%@page import="com.eos.orm.mybatis.model.ViewCheckedBrokerageReport"%>
<%@page import="com.eos.common.tool.ObjectUtils"%>
<%@page import="com.eos.orm.mybatis.model.SysCustomer"%>
<%@page import="com.eos.orm.mybatis.model.ViewBrokerageReport"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html; charset=utf-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<% 
List<ViewCheckedBrokerageReport> checkedReportList = (List<ViewCheckedBrokerageReport>)request.getAttribute("checkedReportList");
List<SysCustomer> customerList = (List<SysCustomer>) request.getAttribute("customerList");
%>
<style>
.searchBar  label{width: 60px;}
</style>
<form id="pagerForm" method="post" action="sysCommissionList">	
	<input type="hidden" name="pageNum" value="${param.pageNum}" />	
</form>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" rel="pagerForm"  method="post" action="sysCommissionList">
	<div class="searchBar" >
	<input type="hidden" name="numPerPage" value="${numPerPage}" />
	<input type="hidden" name="pageNum" value="${pageNum}" /> 
	<table class="searchContent" >
			<tr>
				<td>
					 <label>结算客户：</label> 
                     <select name="customerId" class="combox">
                     	<option value="">-选择结算客户-</option>
                     	<c:forEach var="cu" items="${customerList }">
                     	<option value="${cu.id }" <c:if test="${cu.id eq customerId }">selected="selected"</c:if>>${cu.customerName }</option>
                     	</c:forEach>
                     </select>
				</td>
				<td style="padding-right:0;">
					 <label  style="float:left;">佣金月份：</label>
				     <input type="text" name="startTime" datefmt="yyyy-MM" size="16" value="${startTime }" class="date" style="float:left;" readonly="readonly"/>
					 <a class="inputDateButton" href="javascript:;">选择</a>
				</td>	
				<td>
					<label style="width:10px; padding-right:8px;">~~</label>
				  	 <input type="text" name="endTime" datefmt="yyyy-MM" size="16" value="${endTime }" class="date" style="float:left;" readonly="readonly"/>
					 <a class="inputDateButton" href="javascript:;">选择</a>
				</td>			
				 
				<td>
					 <div class="subBar">
						<ul>
							<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
						</ul>
					</div>
				</td>
			</tr>
		</table>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<!--<li>
				<a class="add" width="420" height="240" style="font-weight: bold;color:#4BBB13;" href="uploadCommissionExcel?navTabId=uploadCommissionExcel" target="dialog" maxable="false" mask="true"><span>导入佣金明细Excel</span>
				</a>
			</li>
			<li class="line">line</li>
			<li>
				<a class="delete" style="font-weight: bold;color:#C1272A;" href="delEmp?empId={sid_empId}"
					target="ajaxTodo" title="确定要删除您所选中的用户吗?"><span>删除佣金明细</span>
				</a>
			</li>
		--></ul>
	</div>
	<table class="table" width="100%" layoutH="115">
		<thead>
			<tr>
				<th>序号</th>
                <th>结算客户</th>
                <th>结算账期</th>
                <th>结算客户佣金</th> 
                <th>易道</th> 
                <th>差额</th>
                <th>核对时间</th>  
                <th>状态</th> 
			</tr>
		</thead>
		<tbody>
			<%
				if(null != checkedReportList){
					int i = 1;
					for(ViewCheckedBrokerageReport vcbr : checkedReportList){
					    double cmon = vcbr.getCustomerTotalMoney();
					    double ydmon = vcbr.getYdTotalMoney();
					    double chae = ydmon - cmon;
					    
		  %>
		   <tr>
		    	<td><%=i++ %></td>
		    	<td>
		    		<% 
		    			for(SysCustomer sc : customerList){
		    			   if(sc.getId().intValue()==vcbr.getCustomerId()){
		    			   	  out.print(sc.getCustomerName()); break;
		    			   }
		    			}
		    		%>
		    	</td>
		    	<td><%=vcbr.getSettlementAccount() %></td>
		    	<td style="color:#cc3333" title="<%=cmon %>">￥<%=ObjectUtils.formatMoney(cmon, "0.00") %></td>
		    	<td style="color:#00f;" title="<%=ydmon %>">￥<%=ObjectUtils.formatMoney(ydmon, "0.00") %></td>
		    	<td title="<%=chae %>">￥
		    	    <%if(chae > 0 || chae < 0){ %>
		    	     <a style="color: #f00;text-decoration: none;"><%=ObjectUtils.formatMoney(chae, "0.00") %></a>
		    	    <%}else{%>
		    	    <a style="color:#006400;text-decoration: none;"><%=ObjectUtils.formatMoney(chae, "0.00") %></a>
		    	    <% } %>
		    	</td>
		    	<td><%=vcbr.getCheckTime() %></td>
		    	<td>已核对</td>
		    </tr>
			<%	    }
				
				}
			
			%>
		</tbody>
	</table>

	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<!-- pageNum:1是当更改numPerPage时，使pageNum=1重新开始，否则可能无数据 -->
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value,pageNum:1})">
				<option value="15" ${numPerPage==15?'selected':''}>15</option>
				<option value="20" ${numPerPage==20?'selected':''}>20</option>
				<option value="25" ${numPerPage==25?'selected':''}>25</option>
				<option value="50" ${numPerPage==50?'selected':''}>50</option>
				<option value="100" ${numPerPage==100?'selected':''}>100</option>
			</select>
			<span>条，共${totalCount }条 </span>
		</div>		
		<div class="pagination" targetType="navTab" totalCount="${totalCount }" numPerPage="${numPerPage}" pageNumShown="5" currentPage="${pageNum }"></div>
	</div>
</div>
